var MessageRenderer = {
    themes: {'0':"flora",'1':"flora",'2':"flora",'3':"flora"},

    render: function(json){
        if(typeof json == 'undefined'){
            return false;
        }

        $.jGrowl.defaults.position = 'bottom-right';
        if(json.type == 0){
         $.jGrowl(json.messageBody, {
                     header:json.messageTitle,
                     theme: 'test',
                     sticky: false,
                     closer: true,
                     corners: '10px',
                     easing: 'swing',
                     life: 5000
                 });
        }
        else {
         $.jGrowl(json.messageBody, {
            header:json.messageTitle,
            theme: MessageRenderer.themes[json.type],
            sticky: false,
            closer: true,
            corners: '10px',
            easing: 'swing',
            life: 5000
        });
        }

    },

    showMessage: function(body,title,type){

        $.jGrowl.defaults.position = 'bottom-right';
        if(type == 0){
         $.jGrowl(body, {
                     header:title,
                     theme: 'test',
                     sticky: false,
                     closer: true,
                     corners: '10px',
                     easing: 'swing',
                     life: 5000
                 });
        }
        else {
         $.jGrowl(body, {
            header:title,
            theme: MessageRenderer.themes[type],
            sticky: false,
            closer: true,
            corners: '10px',
            easing: 'swing',
            life: 5000
        });
        }

    }
}

// $('body').append('<div id ="message-renderer" class="message-renderer"></div>');
// $('#message-renderer').jGrowl(json.message, {
//     theme: 'flora',
//     header: "Flora makes Fauna",
//     sticky: true,
//     closer: false
// });